<template>
    <el-card shadow="always" >
        <el-table :data="pageData" stripe style="width: 100%" v-loading="loading">
            <el-table-column prop="id" label="ID" width="180">
            </el-table-column>
            <el-table-column prop="name" label="用户名" width="180">
            </el-table-column>
            <el-table-column label="操作" align="center" >
            <template #default="{ row }">
                    <p>{{ row.auth }}</p>
              <el-button text type="primary" size="small"  @click="routes.push({path:'/user/authDetail',query:{id:row.id}})">权限</el-button>  
            </template>
            </el-table-column>
        </el-table>
    </el-card>
</template>
<script setup>
import { ref,reactive,computed } from 'vue'
import { getUserAuth } from "@/api/manager.js"
import { useRouter } from 'vue-router'
const routes = useRouter()

const pageData = ref([])
const loading = ref(false)
const getData = async () => {
    loading.value = true
    const res = await getUserAuth()
    console.log(res)
    pageData.value = res.data
    loading.value = false
}
getData()
</script>
